package com.demo3;

public interface NotifyMechanismInterface {
    void doNotify(String msg);

    static NotifyMechanismInterface byEmail() {
        return new NotifyMechanismInterface() {
            @Override
            public void doNotify(String msg) {
                // todo 业务逻辑
                System.out.println("通过邮件通知:" + msg);
            }
        };
    }

    public static void main(String[] args) {
        NotifyMechanismInterface.byEmail();
    }

}
